﻿using System;
using System.Collections.Generic;
//注解
using System.ComponentModel.DataAnnotations;

#nullable disable

namespace RazorPages.Models
{
    public partial class Student
    {
        public Student()
        {
            ScoreLists = new HashSet<ScoreList>();
        }
        [Required]  //不能为空
        [Display(Name = "学号")]
        public int StudentId { get; set; }
        [MinLength(1)] //字符串最小长度
        [Display(Name = "姓名")]
        public string StudentName { get; set; }
        [Display(Name = "性别")]
        public string Gender { get; set; }
        [Display(Name = "出生日期")]
        public DateTime Birthday { get; set; }
        
        [Display(Name = "身份证号")]
        public decimal StudentIdNo { get; set; }
        [Display(Name = "打卡号")]
        public string CardNo { get; set; }
        [Display(Name = "图片")]
        public string StuImage { get; set; }
        [Range(18, 30)]  //指定输入范围
        [Display(Name = "年龄")]
        public int Age { get; set; }
        [RegularExpression("^[0-9]{11,11}$")]   //正则验证  
        [MaxLength(11)]  //字符串最大长度
        [Display(Name = "手机号")]
        public string PhoneNumber { get; set; }
        //[Compare("123")]   比较
        [Display(Name = "住址")]
        public string StudentAddress { get; set; }
        [Display(Name = "班级ID")]
        public int ClassId { get; set; }

        public virtual StudentClass Class { get; set; }
        public virtual ICollection<ScoreList> ScoreLists { get; set; }
    }
}
